<template>
  <div style="height: 100%;width: 100%;overflow: hidden;">
    <iframe
      id="twinIframe"
      class="shadow-sm"
      name="twinIframe"
      title="iframe"
      width="100%"
      height="100%"
      :src="url"
      @load="onIframeLoad"
    />
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      url: './twinMap/index.html'
    }
  },
  created() {
  },
  methods: {
    onIframeLoad() {
      const iframe = document.getElementById('twinIframe').contentWindow
      window.KCDT = iframe.KCDT
      window.ps = iframe.ps
      window.ps && window.ps.addEventListener('message', (res) => {
        this.$emit('psMessage', res)
      })
    }
  }
}
</script>
<style scoped>
.shadow-sm {
  border: none;
  border-width: 0;
  border-style: none;
}
</style>
